﻿<UserControl x:Class="Lardite.RefAssistant.UI.View.ProjectReferencesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:app="clr-namespace:Lardite.RefAssistant"
             xmlns:ld="clr-namespace:Lardite.RefAssistant.UI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>

            <ld:ImageManager x:Key="ImageManager" />

            <DataTemplate x:Key="ItemDataTemplate">
                <StackPanel Margin="1"
                            FlowDirection="LeftToRight" Orientation="Horizontal" 
                            CanHorizontallyScroll="False" CanVerticallyScroll="False">
                    <CheckBox IsChecked="{Binding IsUnused}" ToolTip="{x:Static app:Resources.UI_UnusedReferencesWindow_CheckReference_ToolTip}"/>
                    <Image Margin="3,0,2,0" Source="{Binding AssemblyImage, Mode=OneTime, Source={StaticResource ImageManager}}" />
                    <TextBlock Text="{Binding AssemblyName}" ToolTip="{Binding AssemblyFullName}"  
                               HorizontalAlignment="Stretch"/>
                </StackPanel>
            </DataTemplate>

            <Style TargetType="{x:Type ListBox}">                
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="ItemTemplate" Value="{StaticResourceExtension ItemDataTemplate}"/>
                <Setter Property="IsSynchronizedWithCurrentItem" Value="True"/>
            </Style>
            
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <ListBox ItemsSource="{Binding Path=Project.References}"></ListBox>            
    </Grid>
</UserControl>
